<template>
	<view>
		这是一个登录组件
		<view id="myView">
			父组件传过来的值:{{msg}}
		</view>
		<view>
			<button type="warn" @click="sendMsg()">子组件给父组件进行传值</button>
		</view>
		
	</view>
</template>

<script>
	export default {
		props:["msg"],
		name:"Login",
		beforeCreate() {
			console.log("页面初始化触发beforeCreate")
			console.log("获取绑定的数据对象："+this.num)
		},
		created(){
			console.log("页面初始化触发created")
			console.log("获取绑定的数据对象："+this.num)
		},
		beforeMount() {
			console.log("触发了beforeMount函数")
			console.log("获取页面元素："+document.getElementById("myView"))
		},
		mounted() {
			console.log("触发了Mounted函数")
			console.log(document.getElementById("myView"))
		},
		destroyed(){
			console.log("实例销毁")
		},
		data() {
			return {
				num:100,
				childMsg:"子组件要给父组件传递的值"
			};
		},
		methods:{
			sendMsg(){
				this.$emit("myData",this.childMsg)
			}
		}
		
	}
</script>

<style>

</style>
